package com.java;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

public class QQServer implements Runnable{
	static ServerSocket serverSocket;
	Socket client;
	
	public QQServer(Socket s) {
		this.client = s;	
	}
	
	public void run() {
		
	}
		
	public static void main(String[] args) throws IOException {
		serverSocket = new ServerSocket(3000);
		final Socket s = serverSocket.accept();
		Thread td = new Thread(new Runnable() {
			
			public void run() {
				// TODO Auto-generated method stub
				try {
					BufferedReader read = new BufferedReader(new InputStreamReader(s.getInputStream()));
					PrintWriter writer = new PrintWriter(s.getOutputStream());
					String text;
					
					while((text = read.readLine()) != null){
						writer.println(text);
						writer.flush();
					}
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
	}



}
